package cn.virens.utils;

import java.util.Map;

import cn.virens.common.ObjectUtil;
import cn.virens.database.common.BaseModel;

public class MapConverUtil {
	public static Map<String, Object> toMap(Object obj, String err) {
		Map<String, Object> answer = ObjectUtil.toMap(obj, err);

		if (answer != null && obj instanceof BaseModel) {
			answer.put("createTime", ((BaseModel) obj).getCreateTime());
			answer.put("updateTime", ((BaseModel) obj).getUpdateTime());
			answer.put("id", ((BaseModel) obj).getId());
		}

		return answer;
	}
}
